
function deleteByCode(id) {
	var zh = "\u5220\u9664\u540e\u6570\u636e\u4e0d\u53ef\u6062\u590d!\u662f\u5426\u5220\u9664?";
	var en = "do you delete! data is not be resumed after deleting?";
	var ms = "";
	var language = document.getElementById("language").value;
	if("zh"==language){
		ms=zh;
	}else{
		ms=en;	
	}
	if (confirm(ms)) {
		document.forms[0].id.value = id;
		document.forms[0].operationType.value = "delete";
		document.forms[0].submit();
	} else {
		return;
	}
}
function deleteByCode2(id1,id2) {
	var zh = "\u5220\u9664\u540e\u6570\u636e\u4e0d\u53ef\u6062\u590d!\u662f\u5426\u5220\u9664?";
	var en = "do you delete! data is not be resumed after deleting?";
	var ms = "";
	var language = document.getElementById("language").value;
	if("zh"==language){
		ms=zh;
	}else{
		ms=en;	
	}
	if (confirm(ms)) {
		document.forms[0].id.value = id1;
		document.forms[0].id1.value = id2;
		document.forms[0].operationType.value = "delete";
		document.forms[0].submit();
	} else {
		return;
	}
}
function operation(type) {
	document.forms[0].operationType.value = type;
	document.forms[0].submit();
}
// delete option all values
	function removeChild(select){		
		while(select.options.length>0){
			select.removeChild(select.childNodes[0]);
		}
	}

  var rownum=0;//动态加载的行数
  var numsup=-1;//当前焦点所在的行数
  var strTextName="";//进行动态加载的字段名
  function keyEnter(){
	if(event.keyCode==38){//键盘 向上按钮
		if(numsup<=0){
			return;
		}
		numsup-=1;
		keyCodeTableRow("sup",numsup);
	}
	if(event.keyCode==40){//键盘 向下按钮
		if(numsup>=rownum-1){
			return;
		}
		numsup+=1;	
		keyCodeTableRow("sup",numsup);
	}
	if(event.keyCode==13){//键盘 回车
		if(document.getElementById("rtnList").style.display=="none"||numsup==-1){
			return;
		}
		document.getElementById("row"+numsup).fireEvent("onClick");			
	}
  }

  //回显焦点所在的行的数据
  function show(strObj,code,strCode,name,strName){
  	var objPrompt = document.getElementById(strObj);
	objPrompt.style.display = "none";
	objPrompt.innerHTML = "";
  	document.getElementById(strCode).value = code;
	document.getElementById(strName).value = name;	
	numsup=-1;
  }
  
  function showIn3(strObj,val1,value1,val2,value2,val3,value3){
  	var objPrompt = document.getElementById(strObj);
	objPrompt.style.display = "none";
	objPrompt.innerHTML = "";
  	document.getElementById(val1).value = value1;
	document.getElementById(val2).value = value2;
	document.getElementById(val3).value = value3;
	numsup=-1;
  }
  
  //关闭div
  function col(objPrompt){
  	objPrompt.style.display = "none";
	objPrompt.innerHTML = "";
	numsup=-1;
  }

//设置动态下拉列表的背景色
function keyCodeTableRow(tableId,rowIndex)
{
	var preBgColor = null;
	var table = document.getElementById(tableId);
	if (table == null)
	{
    	return;
	}
	if (table.rules != null)
	{
	    table.rules = "none";
	}
	var tbody = table.getElementsByTagName("tbody")[0];
	var rows = tbody.getElementsByTagName("tr");
	for (var i=0; i < rows.length; i++) 
	{
		rows[i].style.backgroundColor='#F3F6FF';
	}
	rows[rowIndex].style.backgroundColor='#CFE4FE';
}

//失去焦点
function loseFocus(strObj){
  	if(numsup>-1){//动态加载的div有数据
		var objRow = document.getElementById("row"+numsup);
		if(objRow!=null){
			objRow.fireEvent("onClick");
		}
	}else{//动态加载的div无数据
		col(document.getElementById(strObj));
	}
  }

//鼠标划过div中的下拉表的操作
  function FocusTableRow1(tableId,rowIndex)
{
	var preBgColor = null;
	var table = document.getElementById(tableId);
	if (table == null)
	{
    	return;
	}
	if (table.rules != null)
	{
	    table.rules = "none";
	}
	var tbody = table.getElementsByTagName("tbody")[0];
	var rows = tbody.getElementsByTagName("tr");
	for (var i=rowIndex; i < rows.length; i++) 
	{
		rows[i].onmouseover = function() { preBgColor=this.style.backgroundColor; this.style.backgroundColor='#CFE4FE'; numsup=i};
		rows[i].onmouseout = function() { this.style.backgroundColor=preBgColor; numsup=-1};
	}
}